package com.ling.pl.security.feign;

import com.ling.pl.security.model.DefaultOrgVO;
import com.ling.pl.security.model.DefaultPositionVO;
import com.ling.pl.security.model.DefaultUserVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author bo.wang
 */
@RequestMapping("/defaultOrg")
@FeignClient(name = "LING-CLOUD-BASE")
public interface DefaultOrgService extends BaseDefaultOrgService {


    @ApiOperation(value = "loadOrgs")
    @RequestMapping(value = "/loadOrgs", method = RequestMethod.GET)
    public List<DefaultOrgVO> loadOrgs(@RequestParam("parentId") String parentId) throws Exception;

    @ApiOperation(value = "uniqueCheck")
    @RequestMapping(value = "/uniqueCheck", method = RequestMethod.GET)
    public String uniqueCheck(@RequestParam("id") String id);

    @ApiOperation(value = "countChildren")
    @RequestMapping(value = "/countChildren", method = RequestMethod.GET)
    public int countChildren(@RequestParam("parentId") String parentId);

    @ApiOperation(value = "loadPositions")
    @RequestMapping(value = "/loadPositions", method = RequestMethod.GET)
    public List<DefaultPositionVO> loadPositions(@RequestParam("orgId") String orgId);

    @ApiOperation(value = "loadUsers")
    @RequestMapping(value = "/loadUsers", method = RequestMethod.GET)
    public List<DefaultUserVO> loadUsers(@RequestParam("orgId") String orgId);
}

